<HTML><HEAD><TITLE>times(?Factor1, ?Factor2, ?Product)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>times(?Factor1, ?Factor2, ?Product)</H1>
Succeeds if Product is the result of multiplying integer arguments Factor1
and Factor2.


<DL>
<DT><EM>Factor1</EM></DT>
<DD>An integer or a variable.
</DD>
<DT><EM>Factor2</EM></DT>
<DD>An integer or a variable.
</DD>
<DT><EM>Product</EM></DT>
<DD>An integer or a variable.
</DD>
</DL>
<H2>Description</H2>
   Defines the arithmetic relation Factor1 * Factor2 = Product.  If all
   arguments are instantiated times/3 succeeds if this relation holds.  If
   one of the arguments is uninstantiated, it is bound to an integer such
   that the relation holds.  Note that this is not always possible.  If the
   system is in coroutining mode and more than one argument is
   uninstantiated, times/3 delays until at least two of the arguments are
   known.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>times(+, +, -) is det
<LI>times(+, -, +) is semidet
<LI>times(-, +, +) is semidet
</UL>
<H3>Fail Conditions</H3>
Fails if it is impossible to find an integer instantiation such that
   Factor1 * Factor2 = Product holds
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>more than one argument is uninstantiated (non-coroutining    mode only)
<DT><EM>(5) type error </EM>
<DD>an argument is neither an integer nor a variable
</DL>
<H2>Examples</H2>
<PRE>
   Success:
   times(2, 3, 6).
   times(2, 3, Z).                   (gives Z=6)
   times(X, 3, 6).                   (gives X=2)
   times(2, Y, 6).                   (gives Y=3)
   Fail:
   times(3, 4, 5).
   times(3, X, 5).
   Error:
   times(2.0, 3.0, 6.0).             (error 5)
   times(1 + 4, 2, 10).              (error 5)
   times(X, 1, Z).                   (error 4)



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/plus-3.html">plus / 3</A>
</BODY></HTML>
